﻿using PLC.Core.Entities;
using PLC.Interface.Stations;
using System.Linq;
using YWM.Application;
using YWM.Application.Linq.Extensions;

namespace PLC.Application.Stations.Services
{
    internal class StationService : AsyncCrudService<Station, StationResultDto, long, StationResultRequestDto, StationDto>, IStationService
    {
        protected override IQueryable<Station> CreateFilteredQuery(StationResultRequestDto input)
        {
            IQueryable<Station> queryable = base.CreateFilteredQuery(input).WhereIf(input.IsActive != null, s => s.IsActive == input.IsActive);
            return queryable;
        }
    }
}
